<div id="main">
    <h1 class="page-title">Class: simpleMap</h1>
  
    <section>
      <header>
        <h2>
          <span class="attribs"><span class="type-signature"></span></span
          >simpleMap<span class="signature"
            >(HTMLElement, options<span class="signature-attributes">opt</span
            >)</span
          ><span class="type-signature"></span>
        </h2>
      </header>
  
      <article>
        <div class="container-overview">
          <h4 class="name" id="simpleMap">
            <span class="type-signature"></span>new simpleMap<span
              class="signature"
              >(HTMLElement, options<span class="signature-attributes">opt</span
              >)</span
            ><span class="type-signature"></span>
          </h4>
  
          <div class="description">实例化地图对象</div>
  
          <h5>Parameters:</h5>
  
          <table class="params">
            <thead>
              <tr>
                <th>Name</th>
  
                <th>Type</th>
  
                <th>Attributes</th>
  
                <th>Default</th>
  
                <th class="last">Description</th>
              </tr>
            </thead>
  
            <tbody>
              <tr>
                <td class="name"><code>HTMLElement</code></td>
  
                <td class="type">
                  <span class="param-type">HTMLElement</span>
                </td>
  
                <td class="attributes"></td>
  
                <td class="default"></td>
  
                <td class="description last">地图容器（HTML元素）</td>
              </tr>
  
              <tr>
                <td class="name"><code>options</code></td>
  
                <td class="type">
                  <span class="param-type">Object</span>
                </td>
  
                <td class="attributes">&lt;optional&gt;<br /></td>
  
                <td class="default">{}</td>
  
                <td class="description last">地图参数（可选）</td>
              </tr>
            </tbody>
          </table>
  
          <dl class="details"></dl>
  
          <h5>Example</h5>
  
          <pre
            class="prettyprint"
          ><code><span class="com">// 默认参数</span><span class="pln">
  </span><span class="kwd">new</span><span class="pln"> simpleMap</span><span class="pun">(</span><span class="pln">document</span><span class="pun">.</span><span class="pln">getElementById</span><span class="pun">(</span><span class="str">'map'</span><span class="pun">));</span><span class="pln">
  </span><span class="com">// 带地图参数</span><span class="pln">
  </span><span class="kwd">new</span><span class="pln"> simpleMap</span><span class="pun">(</span><span class="pln">document</span><span class="pun">.</span><span class="pln">getElementById</span><span class="pun">(</span><span class="str">'map'</span><span class="pun">),{</span><span class="pln">
       mapOptions</span><span class="pun">:</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
           senceMode</span><span class="pun">:</span><span class="pln"> </span><span class="str">"2D"</span><span class="pun">,</span><span class="pln"> </span><span class="com">// 初始化时，以2D模式进行渲染</span><span class="pln">
       </span><span class="pun">},</span><span class="pln">
  </span><span class="pun">});</span></code></pre>
        </div>
  
        <h3 class="subsection-title">Extends</h3>
  
        <ul>
          <li>Events</li>
        </ul>
  
        <h3 class="subsection-title">Members</h3>
  
        <h4 class="name" id=".this.RightMenu">
          <span class="type-signature">(static) </span>this.RightMenu<span
            class="type-signature"
          ></span>
        </h4>
  
        <div class="description">右键菜单对象</div>
  
        <dl class="details"></dl>
  
        <h4 class="name" id=".this.SenceMode">
          <span class="type-signature">(static) </span>this.SenceMode<span
            class="type-signature"
          ></span>
        </h4>
  
        <div class="description">地图显示模式</div>
  
        <dl class="details"></dl>
  
        <h5>Example</h5>
  
        <pre
          class="prettyprint"
        ><code><span class="pln">map</span><span class="pun">.</span><span class="typ">SenceMode</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">'2D'</span><span class="pln"> </span><span class="com">// 切换为2D 显示模式</span><span class="pln">
  map</span><span class="pun">.</span><span class="typ">SenceMode</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">'3D'</span><span class="pln"> </span><span class="com">// 切换为3D 显示模式</span></code></pre>
  
        <h3 class="subsection-title">Methods</h3>
  
        <h4 class="name" id="addDataSource">
          <span class="type-signature"></span>addDataSource<span class="signature"
            >(dataSourcesEvent)</span
          ><span class="type-signature"></span>
        </h4>
  
        <div class="description">添加地图自定义图层</div>
  
        <h5>Parameters:</h5>
  
        <table class="params">
          <thead>
            <tr>
              <th>Name</th>
  
              <th>Type</th>
  
              <th class="last">Description</th>
            </tr>
          </thead>
  
          <tbody>
            <tr>
              <td class="name"><code>dataSourcesEvent</code></td>
  
              <td class="type">
                <span class="param-type">DataSource</span>
              </td>
  
              <td class="description last">自定义图层</td>
            </tr>
          </tbody>
        </table>
  
        <dl class="details"></dl>
  
        <h4 class="name" id="addProviders">
          <span class="type-signature"></span>addProviders<span class="signature"
            >(MapOptions)</span
          ><span class="type-signature"></span>
        </h4>
  
        <div class="description">添加地图图源</div>
  
        <h5>Parameters:</h5>
  
        <table class="params">
          <thead>
            <tr>
              <th>Name</th>
  
              <th>Type</th>
  
              <th class="last">Description</th>
            </tr>
          </thead>
  
          <tbody>
            <tr>
              <td class="name"><code>MapOptions</code></td>
  
              <td class="type">
                <span class="param-type">Array</span>
              </td>
  
              <td class="description last">添加图源列表</td>
            </tr>
          </tbody>
        </table>
  
        <dl class="details"></dl>
  
        <h5>Example</h5>
  
        <pre
          class="prettyprint"
        ><code><span class="typ">Map</span><span class="pun">.</span><span class="pln">addproviders</span><span class="pun">([{</span><span class="pln">
      </span><span class="str">"type"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"TD"</span><span class="pun">,</span><span class="pln"> </span><span class="com">// 图源类型：TD(天地图)/ARCGIS</span><span class="pln">
      </span><span class="str">"name"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"标注信息"</span><span class="pun">,</span><span class="pln"> </span><span class="com">// 图源名称</span><span class="pln">
      </span><span class="str">"layerType"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"background"</span><span class="pun">,</span><span class="pln"> </span><span class="com">// 图源显示类型 background (背景图) / mark (标注)</span><span class="pln">
      </span><span class="str">"url"</span><span class="pun">:</span><span class="pln"> </span><span class="str">"https://......"</span><span class="pun">,</span><span class="pln"> </span><span class="com">// 地图地址</span><span class="pln">
      </span><span class="str">"default"</span><span class="pun">:</span><span class="pln"> </span><span class="kwd">false</span><span class="pln"> </span><span class="com">// 是否默认开启（多个true时，加载最后一个）</span><span class="pln">
  </span><span class="pun">},</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
  </span><span class="com">// 其他图层信息</span><span class="pln">
  </span><span class="pun">...</span><span class="pln">
  </span><span class="pun">}])</span></code></pre>
  
        <h4 class="name" id="destroy">
          <span class="type-signature"></span>destroy<span class="signature"
            >()</span
          ><span class="type-signature"></span>
        </h4>
  
        <div class="description">注销地图</div>
  
        <dl class="details"></dl>
  
        <h4 class="name" id="flytochina">
          <span class="type-signature"></span>flytochina<span class="signature"
            >()</span
          ><span class="type-signature"></span>
        </h4>
  
        <div class="description">将地图缩放到中国区域</div>
  
        <dl class="details"></dl>
  
        <h4 class="name" id="flytoCustom">
          <span class="type-signature"></span>flytoCustom<span class="signature"
            >(params)</span
          ><span class="type-signature"></span>
        </h4>
  
        <div class="description">自定义缩放位置</div>
  
        <h5>Parameters:</h5>
  
        <table class="params">
          <thead>
            <tr>
              <th>Name</th>
  
              <th>Type</th>
  
              <th class="last">Description</th>
            </tr>
          </thead>
  
          <tbody>
            <tr>
              <td class="name"><code>params</code></td>
  
              <td class="type">
                <span class="param-type">Object</span>
              </td>
  
              <td class="description last">中心点经纬度坐标</td>
            </tr>
          </tbody>
        </table>
  
        <dl class="details"></dl>
  
        <h5>Example</h5>
  
        <pre
          class="prettyprint"
        ><code><span class="pln">map</span><span class="pun">.</span><span class="pln">flytoCustom</span><span class="pun">({</span><span class="pln">
       longitude </span><span class="pun">:</span><span class="pln"> </span><span class="lit">101.435314</span><span class="pun">,</span><span class="pln">
       latitude </span><span class="pun">:</span><span class="pln"> </span><span class="lit">37.960521</span><span class="pun">,</span><span class="pln">
       height </span><span class="pun">:</span><span class="pln"> </span><span class="lit">10000000</span><span class="pun">,</span><span class="pln">
  </span><span class="pun">})</span></code></pre>
  
        <h4 class="name" id="formatPostion">
          <span class="type-signature"></span>formatPostion<span class="signature"
            >(Postion)</span
          ><span class="type-signature"> → {Object}</span>
        </h4>
  
        <div class="description">经纬度转换</div>
  
        <h5>Parameters:</h5>
  
        <table class="params">
          <thead>
            <tr>
              <th>Name</th>
  
              <th>Type</th>
  
              <th class="last">Description</th>
            </tr>
          </thead>
  
          <tbody>
            <tr>
              <td class="name"><code>Postion</code></td>
  
              <td class="type">
                <span class="param-type">Object</span>
              </td>
  
              <td class="description last">
                屏幕拾取X，Y 坐标 转换为 地理经纬度坐标
              </td>
            </tr>
          </tbody>
        </table>
  
        <dl class="details"></dl>
  
        <h5>Returns:</h5>
  
        <dl>
          <dt>Type</dt>
          <dd>
            <span class="param-type">Object</span>
          </dd>
        </dl>
  
        <h4 class="name" id="getProviders">
          <span class="type-signature"></span>getProviders<span class="signature"
            >()</span
          ><span class="type-signature"> → {Array}</span>
        </h4>
  
        <div class="description">获取图源列表</div>
  
        <dl class="details"></dl>
  
        <h5>Returns:</h5>
  
        <div class="param-desc">当前可显示图源列表</div>
  
        <dl>
          <dt>Type</dt>
          <dd>
            <span class="param-type">Array</span>
          </dd>
        </dl>
  
        <h4 class="name" id="getViewer">
          <span class="type-signature"></span>getViewer<span class="signature"
            >()</span
          ><span class="type-signature"> → {Viewer}</span>
        </h4>
  
        <div class="description">获取视图信息</div>
  
        <dl class="details"></dl>
  
        <h5>Returns:</h5>
  
        <div class="param-desc">Cesium 的 Viewer 操作对象</div>
  
        <dl>
          <dt>Type</dt>
          <dd>
            <span class="param-type">Viewer</span>
          </dd>
        </dl>
  
        <h4 class="name" id="removeDataSouce">
          <span class="type-signature"></span>removeDataSouce<span
            class="signature"
            >(dataSourcesEvent)</span
          ><span class="type-signature"></span>
        </h4>
  
        <div class="description">删除自定义图层</div>
  
        <h5>Parameters:</h5>
  
        <table class="params">
          <thead>
            <tr>
              <th>Name</th>
  
              <th>Type</th>
  
              <th class="last">Description</th>
            </tr>
          </thead>
  
          <tbody>
            <tr>
              <td class="name"><code>dataSourcesEvent</code></td>
  
              <td class="type">
                <span class="param-type">DataSource</span>
              </td>
  
              <td class="description last">自定义图层</td>
            </tr>
          </tbody>
        </table>
  
        <dl class="details"></dl>
  
        <h4 class="name" id="viewTo">
          <span class="type-signature"></span>viewTo<span class="signature"
            >(Entitys)</span
          ><span class="type-signature"></span>
        </h4>
  
        <div class="description">缩放到指定位置</div>
  
        <h5>Parameters:</h5>
  
        <table class="params">
          <thead>
            <tr>
              <th>Name</th>
  
              <th>Type</th>
  
              <th class="last">Description</th>
            </tr>
          </thead>
  
          <tbody>
            <tr>
              <td class="name"><code>Entitys</code></td>
  
              <td class="type">
                <span class="param-type">Array</span>
              </td>
  
              <td class="description last">对象集合</td>
            </tr>
          </tbody>
        </table>
  
        <dl class="details"></dl>
  
        <h4 class="name" id="zoomIn">
          <span class="type-signature"></span>zoomIn<span class="signature"
            >()</span
          ><span class="type-signature"></span>
        </h4>
        <div class="description">放大地图</div>
  
        <dl class="details"></dl>
  
        <h4 class="name" id="zoomOut">
          <span class="type-signature"></span>zoomOut<span class="signature"
            >()</span
          ><span class="type-signature"></span>
        </h4>
  
        <div class="description">缩小地图</div>
  
        <dl class="details"></dl>
      </article>
    </section>
  </div>
  